<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 流程用户组列表 </span>
      </div>
      <div>
      </div> 组ID <div class="el-select">
        <el-input v-model="empty" />
      </div> 名称 <div class="el-select">
        <el-input v-model="empty" />
      </div>
      <el-button @click="gotoPage(''+vueparams+'')" type='primary' size="mini"><i class='fa fa-search'></i>搜索</el-button>
      <el-button @click="gotoPage(''+vueparams+'')" type='warning' size="mini"><i class='fa fa-refresh'></i>重置</el-button>
      <el-button @click="gotoPage(''+vueparams+'')" type='success' size="mini"><i class='fa fa-plus'></i>添加</el-button>
      <el-button @click="gotoPage(''+vueparams+'')" type='primary' size="mini"><i class='fa fa-edit'></i>修改</el-button>
      <el-button @click="gotoPage(''+vueparams+'')" type='danger' size="mini"><i class='fa fa-remove'></i>删除</el-button>
      <el-button @click="gotoPage(''+vueparams+'')" type='warning' size="mini"><i class='fa fa-download'></i>导出</el-button>
      <el-table :data="pageList" v-loading="loading" @selection-change="handleSelectionChange">
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="gotoPage('/oa/process/group/edit?'+vueparams+'')">编辑</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="remove('')">删除</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
        <el-table-column label="#" align="center" type='selection'>
        </el-table-column>
        <el-table-column label="组ID" prop="ID_">
        </el-table-column>
        <el-table-column label="名称" prop="NAME_">
        </el-table-column>
      </el-table>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'group',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        loading: true,
        pageList: [],
        pageSize: 10,
        total: null,
        elcheck: [],
        multiple: true,
        rules: {}
      }
    },
    created() {
      this.getPage(1);
    },
    updated() {},
    mounted() {},
    methods: {
      export (_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/oa/process/GroupAction/export?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      remove(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/oa/process/GroupAction/remove?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      getPage(page) {
        this.loading = true;
        request({
          method: 'get',
          url: '/xcapi/VUEAction/oa/process/GroupAction/list?' + this.vueparams,
          params: {
            pageNo: page
          }
        }).then(data => {
          this.loading = false;
          this.pageList = data.rows;
          this.total = data.total;
        })
      },
      handleSelectionChange(selection) {
        this.elcheck = selection.map(item => item["ID_"]);
        this.single = selection.length != 1;
        this.multiple = !selection.length;
      },
    },
  }
</script>
